package com.project.controller;

import com.project.bean.CountBean;
import com.project.service.ICountService;
import com.project.service.ISaleCartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

@RestController
@RequestMapping("count")
@Api(tags = "统计")
public class CountController {
    @Autowired
    private ICountService countService;

    @ApiOperation(value = "动态查询类别总额")
    @GetMapping("findByItem")
    public List<CountBean> findByItem(LocalDate startDate, LocalDate endDate) {
        return countService.findByItem(startDate,endDate);
    }

    @ApiOperation(value = "动态查询产品总额")
    @GetMapping("findBrandByItem")
    public List<CountBean>  findBrandByItem(LocalDate startDate, LocalDate endDate) {
        return countService.findBrandByItem(startDate,endDate);
    }




}
